Skip to content

fix: allow resume_message_count=0 to disable resume history display#235

Open
RyanLHicks wants to merge 2 commits intompfaffenberger:mainfrom
RyanLHicks:fix/allow-zero-resume-message-count
Open

fix: allow resume_message_count=0 to disable resume history display#235
RyanLHicks wants to merge 2 commits intompfaffenberger:mainfrom
RyanLHicks:fix/allow-zero-resume-message-count

Conversation

@RyanLHicks
Copy link
Copy Markdown
Contributor

@RyanLHicks RyanLHicks commented Mar 14, 2026

get_resume_message_count() enforced a minimum of 1, making it impossible to fully disable the resume history display.

Changed the lower bound from 1 to 0 so users can set resume_message_count=0` to suppress the display entirely, as requested in #213.

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted resume message count minimum to allow 0 (disabled) while keeping the 100 maximum.
    • Prevented rendering resumed history when the requested message count is zero or negative, avoiding unnecessary display.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 14, 2026

📝 Walkthrough

Walkthrough

get_resume_message_count now allows 0 as the minimum (previously 1) while still capping at 100; display_resumed_history short-circuits and returns early when the resolved message count is <= 0 to avoid rendering resumed history.

Changes

Cohort / File(s) Summary
Config: resume count clamp
code_puppy/config.py
Lower bound for get_resume_message_count changed from 1 to 0 (still capped at 100); parsing/default/exception behavior unchanged.
Autosave menu: render guard
code_puppy/command_line/autosave_menu.py
display_resumed_history now returns early when num_messages <= 0, preventing rendering when zero or negative counts are requested.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I nibble at bounds, from one down to none,
A quiet little hop—now zero's begun.
No history shows where none should be seen,
A tidy small change, neat and serene.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: allowing resume_message_count=0 to disable resume history display, which is directly supported by changes in both config.py and autosave_menu.py.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@code_puppy/config.py`:
- Line 1137: display_resumed_history currently uses
displayable_history[-num_messages:] which treats num_messages==0 as [-0:] and
returns the full list; update display_resumed_history() to explicitly handle
num_messages <= 0 by returning an empty list (or skipping display) before
performing the slice. Reference the symbols display_resumed_history,
displayable_history, and num_messages (and the config setting
resume_message_count) so you locate the consumer logic and add an early check
like "if num_messages <= 0: return []" (or equivalent control flow) to ensure
zero suppresses history as intended.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 202b760d-cd21-47c4-b380-ca7bf22061d6

📥 Commits

Reviewing files that changed from the base of the PR and between 5115146 and ef0776e.

📒 Files selected for processing (1)
  • code_puppy/config.py

Comment thread code_puppy/config.py
Copy link
Copy Markdown
Owner

@mpfaffenberger mpfaffenberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants